package com.itheima.admin.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @Author longbosheng
 * @Date 2022/6/18 9:46
 * @PackageName:com.itheima.pojo
 * @ClassName: Setmeal
 * @Description: TODO
 * @Version 1.0
 */
@Data
@TableName("setmeal")
@Component
public class Setmeal {
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id; //编号
    private String type;
    @TableField(value = "category_id")
    private String categoryId; //所属分类
    private String name; //套餐名
    private BigDecimal price; //价格
    private int status; //0禁用 1启用
    private String code;
    private String description; //描述
    private String image; //配图
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(value = "create_time")
    private Date createTime;//创建时间
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(value = "update_time")
    private Date updateTime;//更新时间
    @TableField(value = "create_user")
    private String createUser;//创建人
    @TableField(value = "update_user")
    private String updateUser; //修改人
    @TableField(select = false, exist = false)
    private List<SetmealDishes> setmealDishes;
    @TableField(exist = false)
    private String categoryName;//分类名
}
